﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

using COUP.Auth.Networking;
using COUP.Core.Networking;

namespace COUP.Auth
{
    static class Program
    {
        private static ConnectionHandler Connection;

        public static int Logins = 1000000;

        public static void Output(string Output)
        {
            Monitor.Enter(Console.Out);
            Console.WriteLine("[Auth Server] " + Output);
            Monitor.Exit(Console.Out);
        }

        static void Main(string[] StartArgs)
        {
            Title(StartArgs[0]);            

            Connection = new ConnectionHandler();

            Configure();

            Output("Server is Online");
            Input();
        }

        static void Configure()
        {
            Connection.Handle += new PacketEventHandler(PacketHandler.Handle_Packet);
        }

        static void Title(string Title)
        {            
            Console.Title = Title + " Server";
        }

        static void Input()
        {
            while (true)
            {
                string com = Console.ReadLine().ToLower();

                switch (com)
                {
                    case "exit": return;
                }
            }
        }
    }
}
